<template>
	<view>
		
	</view>
</template>

<script setup>
	import {
		ref
	} from "vue";
	import {
		onLoad
	} from "@dcloudio/uni-app";
	import {
		apiChannelInfo
	} from "@/api/channel";
	import {
		redirectToWechatAuth
	} from "@/config/config";
	import {
		getUrlParam
	} from "@/utils/utils";
	
	//页面加载
	onLoad( async (option) => {
		if (option.channel) {
			uni.setStorageSync("channel", option.channel);
		}
		const isJump = await getChannelInfo();
		if(isJump){
			return;
		}
		uni.redirectTo({
			url: '/pages/index/ads'
		});
	});
	
	//查询渠道设置
	const getChannelInfo = async () => {
		const res = await apiChannelInfo({
			channel: uni.getStorageSync('channel')
		});
		if (res.is_jump) {
			window.location.href = res.jump_link;
			return true;
		}else{
			return false;
		}
	}
</script>

<style>
	       
</style>
